package myapp.com.myapplication;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;


import me.everything.android.ui.overscroll.HorizontalOverScrollBounceEffectDecorator;
import me.everything.android.ui.overscroll.adapters.RecyclerViewOverScrollDecorAdapter;
import myapp.com.myapplication.Adapter.BaseViewHolder;
import myapp.com.myapplication.Adapter.CommonAdapter;

public class MyAdapter extends CommonAdapter<String> {

    private List<String> list = new ArrayList<>();
    private Context context;

    public MyAdapter(Context context, int itemLayoutId) {
        super(context, itemLayoutId);
        this.context = context;
        for (int i = 0; i < 30; i++) {
            list.add("1111");
        }
        super.setListData(list);
    }

    @Override
    public void convert(BaseViewHolder helper, String item) {
        RecyclerView recyclerView = helper.getView(R.id.rv);
        LinearLayoutManager ms = new LinearLayoutManager(context);
        ms.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(ms);
        MyAdapter2  myAdapter = new MyAdapter2(context, R.layout.item2);
        recyclerView.setAdapter(myAdapter);
        new HorizontalOverScrollBounceEffectDecorator(new RecyclerViewOverScrollDecorAdapter(recyclerView));
    }
}
